//
//  NotesTableViewCell.m
//  远方
//
//  Created by 1564335 on 15-6-6.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "NotesTableViewCell.h"
#import <UIImageView+AFNetworking.h>
@implementation NotesTableViewCell

- (void)dealloc
{
    [_image release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.image = [[UIImageView alloc] init];
        [self.contentView addSubview:self.image];
    }
    return self;
}


- (void)setNotesParser:(StrategyNotesParser *)notesParser
{
    self.image.frame = CGRectMake(0, 0, 150 * (notesParser.width / (CGFloat)notesParser.height), 150);
    [self.image setImageWithURL:[NSURL URLWithString:notesParser.photo_url] placeholderImage:[UIImage imageNamed:@"defaultPicture"]];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
